    <div class="col-md-12 col-sm-12 col-xs-12">
        <?php $form = $this->beginWidget('CActiveForm', array(
                'id'            => 'albums-form',
                'enableClientValidation' => true,
                'enableAjaxValidation'   => true,
                'clientOptions' => array(
                    'validateOnSubmit' => true,
                ),
                'htmlOptions'   => array(
                    'enctype' => 'multipart/form-data',
                    'class'   => 'form-horizontal',
                )
            )
        ); ?>
        <div class="form-group clearfix">
            <?php echo $form->labelEx($model, 'category_id', array('class' => 'col-md-3 col-sm-3 control-label')); ?>
            <div class="col-md-6 col-sm-6">
                <?php echo $form->dropDownList($model, 'category_id', CHtml::listData(Category::model()->findAll(), 'id', 'category_name')); ?>
            </div>
            <?php echo $form->error($model, 'category_id'); ?>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model, 'title', array('class' => 'col-md-3 col-sm-3 control-label')); ?>
            <div class="col-md-6 col-sm-6">
                <?php echo $form->textField($model, 'title', array('class' => 'form-control')); ?>
            </div>
            <?php echo $form->error($model, 'title'); ?>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model, 'desc', array('class' => 'col-md-3 col-sm-3 control-label')); ?>
            <div class="col-md-6 col-sm-6">
                <?php echo $form->textArea($model, 'desc', array('class' => 'form-control')); ?>
            </div>
            <?php echo $form->error($model, 'desc'); ?>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model, 'tag', array('class' => 'col-md-3 col-sm-3 control-label')); ?>
            <div class="col-md-6 col-sm-6">
                <?php echo $form->textField($model, 'tag', array('class' => 'form-control')); ?>
            </div>
            <?php echo $form->error($model, 'tag'); ?>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model, 'thumbnail_image', array('class' => 'col-md-3 col-sm-3 control-label')); ?>
            <div class="col-md-6 col-sm-6">
                <?php echo $form->hiddenField($model, "thumbnail_image"); ?>
                <?php $this->widget('CMultiFileUpload', array(
                        'name'      => 'thumbnail_image',
                        'accept'    => 'jpeg|jpg|gif|png', // useful for verifying files
                        'duplicate' => 'Duplicate file!', // useful, i think
                        'denied'    => 'Invalid file type',
                        // useful, i think
                    ));
                echo $form->error($model, 'thumbnail_image');

                if ($model->thumbnail_image):
                    $image = explode(',', $model->thumbnail_image);
                    foreach ($image as $k => $file):
                        ?>
                        <div class="clearfix"></div>
                        <span><?php echo $file; ?> &nbsp;
                <a href="javascript:;" onclick="javascript:removeFile('<?php echo $file; ?>', <?php echo $k; ?>)" title="Remove"
                   class="remove_<?php echo $k; ?>">Remove File</a></span>
                        <div class="clearfix"></div>
                    <?php
                    endforeach;
                endif;?>
            </div>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($model, 'status', array('class' => 'col-md-3 col-sm-3 control-label')); ?>
            <div class="col-md-6 col-sm-6">
                <?php echo $form->dropDownList($model, 'status', Lookup::items('STATUS')); ?>
            </div>
        </div>
        <div class="col-sm-6 col-sm-offset-3">
            <div class="pull-right">
                <?php echo CHtml::submitButton($model->isNewRecord ? 'Tạo mới' : 'Sửa', array('class' => 'btn btn-primary m-b-10')); ?>
                <?php echo CHtml::resetButton('Nhập lại', array('class' => 'btn btn-default m-b-10')); ?>
            </div>
        </div>
        <?php $this->endWidget(); ?>
    </div>

<?php
$scriptDelete = '
if("' . $model->thumbnail_image . '" != ""){
    function removeFile(fileName, pos) {
        var url = "' . Yii::app()->controller->createUrl('/backend/default/deleteimage') . '";
        var imageID = "' . $model->id . '";
        var colImage = "thumbnail_image";

        $.post(
            url, { imageID: imageID, colImage: colImage, imageName: fileName, model: "Albums" },
            function(data){
                $("a.remove_"+pos).parent().remove();
                parent.window.location = parent.window.location
            }, "json"
        );

        return false;
    }
}
';
Yii::app()->clientScript->registerScript('scriptDelete', $scriptDelete, CClientScript::POS_END);